#ifndef __cursor_h__
#define __cursor_H__

#include "SEL.h"
#include "SEL_resources.h"

namespace SEL
{

class Cursor  : public Object
{
public:
	Cursor (Surface *surface = NULL, int hot_x = 0, int hot_y = 0);
	virtual ~Cursor ();
	
	void setSurface (Surface *surface);
	Surface * surface () 			{ return m_surface; }
	const Surface * surface () const	{ return m_surface; }
	void releaseSurface ();
	
	void setHotX (int hot_x);
	int hotX ()				{ return m_hot_x; }
	
	void setHotY (int hot_y);
	int hotY ()				{ return m_hot_y; }
		
protected:
	Surface *m_surface;
	int m_hot_x;
	int m_hot_y;
};

class ResourceCursor : public ResourceSurface
{
public:
	ResourceCursor (const std::string & name,
			const std::string & location,
			const ResourceProperties & properties);
			
	~ResourceCursor ();
	
	virtual void load (RWops & ops);

	virtual void free ();
	
	virtual bool loaded () const		{ return m_cursor != NULL; }
	
	virtual bool hasData ()	const		{ return true; }
	
	virtual void *data ()			{ return (void*) m_cursor; }
	
	virtual const void *data () const 	{ return (void*) m_cursor; }
	
	Cursor *cursor ()			{ return m_cursor; }
	
	const Cursor *cursor () const		{ return m_cursor; }
	
protected:
	Cursor *m_cursor;
};

Cursor * getCursor (Resource *res);

};

#endif // __cursor_H__

